package com.huibo.aigou.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huibo.aigou.base.bo.PageObj;
import com.huibo.aigou.base.bo.PageQuery;
import com.huibo.aigou.domain.Brand;
import com.huibo.aigou.mapper.BrandMapper;
import com.huibo.aigou.service.BrandService;

@Service
public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements BrandService{

	public PageObj<Brand> pageList(PageQuery pageQuery) {
		Page<Brand> page = new Page<>(pageQuery.getPage(), pageQuery.getRows());
		IPage<Brand> ipage = baseMapper.pageList(page, pageQuery);
		return new PageObj<>(ipage.getTotal(),ipage.getRecords());
	}
}
